.class public Lrexsee/network/RexseeBluetoothPrinter;
.super Ljava/lang/Object;
.source "RexseeBluetoothPrinter.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "BluetoothPrinter"


# instance fields
.field private final mBluetooth:Lrexsee/network/RexseeBluetooth;

.field private final mBrowser:Lrexsee/core/browser/Browser;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 3
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 25
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 26
    iput-object p1, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBrowser:Lrexsee/core/browser/Browser;

    .line 27
    iget-object v0, p1, Lrexsee/core/browser/Browser;->interfaceList:Lrexsee/core/browser/clazz/JavascriptInterfaceList;

    new-instance v1, Ljava/lang/StringBuilder;

    iget-object v2, p1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v2, v2, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v2, v2, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, "Bluetooth"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/JavascriptInterfaceList;->get(Ljava/lang/String;)Lrexsee/core/browser/clazz/JavascriptInterface;

    move-result-object v0

    check-cast v0, Lrexsee/network/RexseeBluetooth;

    iput-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    .line 28
    return-void
.end method

.method private bluetoothError()V
    .locals 3

    .prologue
    .line 31
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/network/RexseeBluetoothPrinter;->getInterfaceName()Ljava/lang/String;

    move-result-object v1

    const-string v2, "Printer Error: Bluetooth error is not found."

    invoke-virtual {v0, v1, v2}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 32
    return-void
.end method


# virtual methods
.method public awake()V
    .locals 2

    .prologue
    .line 42
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    if-nez v0, :cond_0

    .line 43
    invoke-direct {p0}, Lrexsee/network/RexseeBluetoothPrinter;->bluetoothError()V

    .line 47
    :goto_0
    return-void

    .line 46
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    const-string v1, "0"

    invoke-virtual {v0, v1}, Lrexsee/network/RexseeBluetooth;->writeASCII(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 15
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 11
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "BluetoothPrinter"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 19
    new-instance v0, Lrexsee/network/RexseeBluetoothPrinter;

    invoke-direct {v0, p1}, Lrexsee/network/RexseeBluetoothPrinter;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public init()V
    .locals 2

    .prologue
    .line 35
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    if-nez v0, :cond_0

    .line 36
    invoke-direct {p0}, Lrexsee/network/RexseeBluetoothPrinter;->bluetoothError()V

    .line 40
    :goto_0
    return-void

    .line 39
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    const-string v1, "27,64"

    invoke-virtual {v0, v1}, Lrexsee/network/RexseeBluetooth;->writeASCII(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public nextPage()V
    .locals 2

    .prologue
    .line 49
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    if-nez v0, :cond_0

    .line 50
    invoke-direct {p0}, Lrexsee/network/RexseeBluetoothPrinter;->bluetoothError()V

    .line 54
    :goto_0
    return-void

    .line 53
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    const-string v1, "12"

    invoke-virtual {v0, v1}, Lrexsee/network/RexseeBluetooth;->writeASCII(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public setToChinese()V
    .locals 2

    .prologue
    .line 56
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    if-nez v0, :cond_0

    .line 57
    invoke-direct {p0}, Lrexsee/network/RexseeBluetoothPrinter;->bluetoothError()V

    .line 61
    :goto_0
    return-void

    .line 60
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    const-string v1, "28,38"

    invoke-virtual {v0, v1}, Lrexsee/network/RexseeBluetooth;->writeASCII(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public setToEnglish()V
    .locals 2

    .prologue
    .line 63
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    if-nez v0, :cond_0

    .line 64
    invoke-direct {p0}, Lrexsee/network/RexseeBluetoothPrinter;->bluetoothError()V

    .line 68
    :goto_0
    return-void

    .line 67
    :cond_0
    iget-object v0, p0, Lrexsee/network/RexseeBluetoothPrinter;->mBluetooth:Lrexsee/network/RexseeBluetooth;

    const-string v1, "28,46"

    invoke-virtual {v0, v1}, Lrexsee/network/RexseeBluetooth;->writeASCII(Ljava/lang/String;)V

    goto :goto_0
.end method
